import { CONDITIONS } from '@/config'
const defaultValue = {}
export default {
  method: 'get',
  url: '/api/logs/config_data',
  defaultValue,
  transformParam: () => {
    return {
      key: CONDITIONS,
    }
  },
  transformResponse: response => {
    const { data = {} } = response
    const { content } = data

    try {
      const result = content === '' ? defaultValue : JSON.parse(content)
      return result
    } catch (e) {
      console.error('getConditions error', e)
      return []
    }
  },
}
